package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 积分渠道
 * Created by zhangjh on 2016/12/14.
 */
@Entity
@Table(name = "integration_channel")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class IntegrationChannel extends IDEntityMall {

    @Column(columnDefinition = "bigint(20) comment '平台ID'")
    private Long mallId;

    @Column(columnDefinition = "varchar(100) comment '名称'")
    private String name;

    @Column(columnDefinition = "varchar(100) comment '第三方平台认证'")
    private String appKey;

    @Column(columnDefinition = "varchar(100) comment '第三方平台认证密钥'")
    private String appSecret;
    // 生成渠道appKey前缀
    public static final String ROCK_CENT_APP_KEY = "rockCent_appKey_";

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAppKey() {
        return appKey;
    }

    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }

    public String getAppSecret() {
        return appSecret;
    }

    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }

    @Override
    public String toString() {
        return "IntegrationChannel{" +
                "mallId=" + mallId +
                ", id=" + id +
                ", name='" + name + '\'' +
                ", dateCreated=" + dateCreated +
                ", appKey='" + appKey + '\'' +
                ", appSecret='" + appSecret + '\'' +
                ", lastUpdated=" + lastUpdated +
                ", isDelete=" + isDelete +
                ", version=" + version +
                '}';
    }
}
